<template>
  <div id="app" :class="['theme theme-'+theme,'language-'+language]">
    <!-- {{$t("setting.title")}} -->
    <routerNav :nav="nav"></routerNav>
    <themeDesign></themeDesign>
    <sysConfig :plus="sysConfigPlus"></sysConfig><!---->
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  components: {},
  data(){
    return{
      init:0,
      adminNav:[],
      nav:[
        {title:"数据屏A-多语言",path:"/screenAGlobal"},
        {title:"数据屏A",path:"/screenA"},
        {title:"数据屏C",path:"/screenC"},
        {title:"数据屏D",path:"/screenD"},
        {title:"3D面板",path:"/board3D"},
        {title:"科技边框",path:"/borderDemo"},
        {title:"图表配色工具",path:"/chartPalette"},
      ],
      sysConfigPlus:[
        {title:"tip",tip:"tip",label:"tip",type:"switch",value:true},
      ]
    }
  },
  watch: {
		"$vuex.state.globalConfig.themeDesign"(val){
      // cl("val",val)
    }
	},
  computed:{
    language(){
      return this.$vuex.state.globalConfig.language
    },
    theme(){
      return this.$vuex.state.globalConfig.theme
    }
  },
  methods: {
    routerGo(path){
      if(this.$route.path!=path){
        // cl("routerGo",path);
        this.$router.push(path);
      }
    },
    initDT(){
      this.init++;
      if(this.init==2){
        return;
      }
      if(A("dt")=="mobile"){
        this.$vuex.state.deviceType="mobile"
        this.routerGo("/screenMobileA");
      }else{
        this.$vuex.state.deviceType="pc"; 
      }
      
    }
  },
  mounted(){
    let preload =document.querySelector("#preLoading")
    if(preload){
      preload.remove();
    }
    if(process.env.NODE_ENV=="development"){
      this.nav=_.concat(this.nav, this.adminNav)
    }else if(process.env.NODE_ENV=="production"){
      
    }
    
  },
  beforeDestroy() {
    A("ra",A("qs",'body'));
  },


}

</script>

<style lang="less">
#app { .poa; .fullbox; font-family: 'Avenir', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.pre-loading{.poa; .fullbox; z-index: 20; .bgc(fade(@bk,50%)); // .bdFilter;
  .desc{.absoluteCenter; .fc(@wh); font-size: 32px; .ff("cn0");}
}

</style>
